﻿@{
    ViewBag.Title = "Project";
    Layout = "~/Views/Shared/_Layout.cshtml";
    Html.EnableUnobtrusiveJavaScript(true);
}
@using P2PWeb;
@using P2PWeb.Common;
@model OrderDetail

<link href="@Url.Content("~/Content/LendrsDetail_Style.css?ver=0.2")" rel="stylesheet" type="text/css" />
<link href="@Url.Content("~/Content/bootstrap.min.css")" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="@Url.Content("~/Scripts/bootstrap.min.js")"></script>
<script type="text/javascript" src="@Url.Content("~/Scripts/jquery-ui-1.10.4.min.js")"></script>
<script type="text/javascript" src="@Url.Content("~/Scripts/jquery.validate.min.js")"></script>
<script type="text/javascript" src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")"></script>
<script  src="@Url.Content("~/scripts/app/citys.js")"  type="text/javascript" ></script>
<script type="text/javascript" src="@Url.Content("~/Scripts/app/LendrsDetail.js?ver=0.2")"></script>


<script type="text/javascript">
    $(function () {
        //年利率后面的提示
        $('a.askIcon').each(function () {
            $(this).mouseover(function () {
                $(this).prev().css('display', 'block');
            });

            $(this).mouseleave(function () {
                $(this).prev().css('display', 'none');
            });
        });
    });
</script>

@using (Html.BeginForm("Lending", "lend"))
{ 
    @Html.HiddenFor(m => m.Id)
    @Html.Hidden("IsLogin", BaseController.IsLogin(HttpContext.Current))

    
    <div id="ConfirmDialog" class="modal fade">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
                    <h4 class="modal-title">立即投标</h4>
                </div>
                <div class="modal-body">
                    <div class="container-fluid">
                        <div class="row">
                            <div class="col-md-4">
                                <div class="container-fluid">
                                    <div class="row">
                                        <div class="col-md-12">
                                            @*<img src="/Images/touxiang.jpg" width="149" height="134" />*@
                                            <img src="~/Images/project.png" width="140" height="140" />
                                        </div>
                                    </div>
                                    <div class="row">
                                        <div class="col-md-12">
                                            <p class="text-center">@Model.Mortgage 第 @Model.Id 期</p>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <div class="col-md-8">
                                <table width="100%">
                                    <tr>
                                        <td><p class="text-justify">借款金额：</p>
                                        </td>
                                        <td>
                                            <p class="text-justify">
                                                @Model.Money 元
                                            </p>
                                        </td>

                                    </tr>
                                    <tr>
                                        <td><p class="text-justify">年利率：</p></td>
                                        <td>
                                            <p class="colred fb text-justify">@Model.AnnualInterest.CustomFormat("P")</p>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td><p class="text-justify">借款期限：</p></td>
                                        <td>
                                            <p class="colred fb text-justify">@Model.TimeSpan</p>
                                        </td>

                                    </tr>
                                    <tr>
                                        <td><p class="text-justify">剩余可投金额：</p></td>
                                        <td>
                                            <p class="text-justify">@Model.SurplusMoney.CustomFormatN()元</p>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td><p class="text-justify">投标金额：</p></td>
                                        <td>
                                            <p class="text-justify" id="putMoeny"></p>
                                        </td>

                                    </tr>
                                    <tr>
                                        <td><p class="text-justify">投标利率：</p></td>
                                        <td>
                                            <p class="text-justify">@Model.AnnualInterest.CustomFormat("P")</p>
                                        </td>
                                    </tr>
                                </table>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="modal-footer">
                    <button type="button" id="ModelSubmitBtn" class="btn btn-default">确定</button>
                    <button type="button" class="btn btn-primary" data-dismiss="modal">取消</button>
                </div>
            </div>

        </div>
    </div>
    <div class="main main_green">
        <div class="main_green_top"><span class="main_green_top_right"></span></div>
        <div class="main_box pt0 pb0 pr30 pl30 pr" style="margin-top:130px;">
            <span class="pa tender_hot dib png"></span>
            <h2 class="content_title ml_neg_22 png">@Model.Mortgage 第 @Model.Id 期</h2>
            <a name="bid"></a>
            <h4 class="fb f14 mt30 mb30 ml20"></h4>
            <div class="borrowApplyDetail borrowBox br5 bc pt30 pl15 pr15 pb30">
                <span class="picIconJyb"></span>
                <table cellspacing="0" cellpadding="0">
                    <tbody>
                        <tr>
                            <td class="tc vt" rowspan="9">
                                <div class="img_temp2 bc png">
                                     <img src="~/Images/project.png" width="140" height="140" />
                                </div>
                                <p style="text-align: center">
                                    借款人：@Model.LoanPerson
                                </p>
                            </td>
                            <td class="tl pl30"></td>
                        </tr>
                        <tr>
                            <td class="tl pl30 pb20">
                                <strong>借款金额：</strong><span class="colred fb">@(Model.Money/10000)</span>万元
                        		<strong class="pl20">年利率：</strong><span class="colred fb">@Model.AnnualInterest.CustomFormat("P")</span>
                                <strong class="pl20">借款期限：</strong><span class="colred fb">@Model.TimeSpan</span>
                            </td>
                        </tr>
                        <tr>
                            <td class="tl pl30 pb20"><strong>还款类型：</strong>@Model.CalcType</td>
                        </tr>
                        <tr>
                            <td class="tl pl30 pb20">
                                <strong>投标进度：</strong>
                                <div class="loadingNum dib vb">
                                    <span class="loadingNum_text">投标完成:@Model.FinishRate.CustomFormat("P")</span>
                                    <div style="width: @Model.FinishRate.CustomFormat("P");" class="loadingNum_bar"></div>
                                </div>
                            </td>
                        </tr>
                        @{
                                            if (Model.Status == 3)
                                            {
                            <tr>
                                <td class="tl pl30 pb20"><strong>开售时间：</strong>@Model.StartDate.ToString("yyyy-MM-dd HH:mm:ss")</td>
                            </tr>
                                           
                    
                            <tr>
                                <td class="tl pl30 pb20">
                                    <strong>可投金额：</strong>
                                    <span class="colred fb">@Model.SurplusMoney</span>元
                        		<span class="pl15 colred"></span>
                                </td>
                            </tr>
                            <tr>
                                <td class="tl pl30 pb20">
                                    <label for="orderAmt75563"><strong>投标金额：</strong></label>
                                    @Html.TextBoxFor(m => m.LendMoney, new { @class = "w100 mr10" })
                                    @Html.ValidationMessageFor(m => m.LendMoney)
                                    <span id="planAmtRate75563"></span>
                                </td>
                            </tr>
                            <tr>
                                <td class="tl pl30 pb20 vb">
                                    <a class="tsa_btn tsa_btn_tender fontClear fl" id="puting">立即投标</a>
                                </td>
                            </tr>
                                            }
                        }
                    </tbody>
                </table>
            </div>
            <h2 class="content_title ml_neg_22 png">借款方信息</h2>
            <div class="borrowBox borrowerInformation mt30 clearfix pb20 mb30">
                @foreach (var item in ((List<P2PWeb.Models.CampUpLoad>)ViewData["upload_list"]).Where(o => o.Type == 1))
	            {
		            <div class="picture"><img src="~/Attachments/@item.UpLoad" alt="图片未显示" height="140" width="210" /></div>
	            }
                  <div class="mg">&nbsp;&nbsp;&nbsp;&nbsp;@ViewData["Info"]</div>   
            </div>
            <h2 class="content_title ml_neg_22 png">项目信息</h2> 
            <div class="borrowBox borrowerInformation mt30 clearfix pb20 mb30">
                @foreach (var item in ((List<P2PWeb.Models.CampUpLoad>)ViewData["upload_list"]).Where(o => o.Type == 2))
	            {
		            <div class="picture"><img src="~/Attachments/@item.UpLoad" alt="图片未显示" height="140" width="210" /></div>
	            }
                <div class="mg">&nbsp;&nbsp;&nbsp;&nbsp;@ViewData["Info"]</div>   
            </div>
            <h2 class="content_title ml_neg_22 png">投标记录</h2>
            <table align="center" class="rec_list">
                   <tr>
                      <td><strong>借款人</strong></td>
                      <td><strong>借款金额</strong></td>
                      <td><strong>借款时间</strong></td>
                   </tr>
                </table>
              <div class="record">
                <table align="center" class="detail">
                   @if (Model.flight == null)
                   {
                     <tr>
                         <td colspan="3" style="color:red;">暂无投标记录</td>
                     </tr>   
                   }
                   else
                   {
                       foreach (P2PWeb.Models.Flight flig in Model.flight)
                       {
                      <tr class="tr">
                        @{
                           string str = Model.LoanPerson;
                           <td width="100">@str.Substring(0, 1)**</td>
                          }
                          <td width="250">@flig.Amount</td>
                          @{
                           string time = Convert.ToDateTime(flig.CreationTime).ToString("yyyy-MM-dd");
                          <td>@time</td>
                          }
                      </tr>
                       }
                   }
               </table>
              </div>
            @*<ul class="tl w mt15 mb50">
                <li class="dib w124 mt10 tc">
                    <div class="img_temp1 bc png">
                        <img src="/Images/headDefault.png" alt="" title="" width="80" height="80" />
                    </div>
                    <span class="col666 mw100 ell dib">xuevic</span> 
                </li>
            </ul>*@
        </div>
        <div class="main_green_bottom"><span class="main_green_bottom_right"></span></div>
    </div>
}
